package com.bwie.task;

import com.bwie.mapper.CustomerMapper;
import com.bwie.mq.MessageConsumer;
import com.bwie.mq.MessageProduct;
import com.bwie.pojo.po.Customer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class SpringTask {
        @Autowired
        private MessageProduct product;
        @Autowired
        private CustomerMapper customerMapper;
    @Scheduled(cron = "0 35 11 * * ?")
    public void ting(){
       List<Customer> characterList= customerMapper.selectState(0);
        for (Customer customer : characterList) {
            product.setAmqpTemplate(customer);
        }

    }
}
